// 班级升级时备份的班级信息
class ClassBackup {

    String level //等级  （小学、初中、高中）
    int grade // 年级 (一年级....)
    int team // 班
    Teacher master  //班主任
    String term //学期

    static hasMany = [ student : StudentBackup , teachers : Teacher ]

    Classes classes

    int year = Calendar.instance.get(Calendar.YEAR)

    static mapping = {
       table 'xedu_class_backup'
 
       student sort : 'name' , order : 'asc'
    }

    static constraints = {
        level()
        grade()
        team()
        master()
        term()
        classes()
      
    }

    String toString() {
        "${classes} ${year}${term}"
    }

}
